import React from 'react';
import {HashRouter, Route, Switch} from 'react-router-dom';
import "./index.scss";
import "@assets/css/fontSize.scss";
import Home from './pages/Home/index';
import Detail from './pages/Dashboard/index';
import {Header} from "@/component/Header";
import {Join} from "@/pages/Join/Join";
import {Login} from "@/pages/Login/Login";
import {M404} from "@/pages/404/404";
import {Index} from "@/pages/Index/Index";
import {IndexSearch} from "@/pages/IndexSearch/IndexSearch"
import ImgSlice from "@/pages/ImgSlice/ImgSlice";
import {VideoDetail} from "@/pages/VideoDetail/VideoDetail";
let arr = [{
    path: "/home",
    label: "首页",
    subMenu: []
}, {
    path: "/detail",
}, {
    path: "Login",
    compents: Login
}
    , {
        path: "/Join",
    }
]

// 画版一 蓝湖
function home() {
    return (<div><Header></Header><Home></Home></div>)
}

const BasicRoute = () => {

    return (
        <HashRouter>
            <Switch>
                <Route exact path="/" component={Index}/>
                <Route exact path="/home" component={home}/>
                <Route exact path="/detail" component={Detail}/>
                <Route exact path="/Login" component={Login}/>
                <Route exact path='/IndexSearch' component={IndexSearch}/>
                <Route exact path='/imgsile' component={ImgSlice}/>
                <Route exact path='/VideoDetail/:id' component={VideoDetail}/>
                {
                    arr.map((item, index) => {
                        return <Route exact path={item.path} component={Detail} key={index}/>
                    })
                }
                <Route exact path='*' component={M404}></Route>
            </Switch>
        </HashRouter>
    )
};


export default BasicRoute;